<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
</head>
<body>
    
    <button id="eee">复制(Hello, world!)</button>

    <script src="clipboard.min.js"></script>
    <script>
        var clipboard = new ClipboardJS('#eee', {
			text: function(){
				return 'Hello, world!'
			}
		});
        console.log(clipboard);
        
        clipboard.on('success', function(e) {
            console.info('Action:', e.action);
            console.info('Text:', e.text);
            console.info('Trigger:', e.trigger);

            e.clearSelection();
        });

        clipboard.on('error', function(e) {
            console.error('Action:', e.action);
            console.error('Trigger:', e.trigger);
        });
    </script>

</body>
</html>